package com.atguigu05.method_more._02args.exer;

/**
 * ClassName: contact
 * Package: com.atguigu05.method_more._02args.exer
 * Description:
 *
 * @Author xiao_qi
 * @Create 2024/3/30 22:56
 * @Version 1.0
 */
public class contact {
    public static void main(String[] args) {
        contact test = new contact();
        String info = test.contact("-","hello","world");
        String info2 = test.contact("hello","edd");
        System.out.println(info);
        System.out.println(info2);
    }

    public String contact(String add,String ...adds){
        String result = " ";

        for (int i = 0; i < adds.length; i++) {
            if (i == 0) {
                result += adds[i];
            }
            else {
                result += (add + adds[i]);
            }
        }
        return result;
    }

}
